/**
 * Copyright 2009 Adam Ruggles.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.code.sapien.guice;

import java.util.Properties;

/**
 * Configuration interface.
 * @author Adam
 * @version $Id: Configuration.java 11 2009-03-27 06:33:32Z a.ruggles $
 * 
 * Created on Feb 7, 2009 at 6:13:30 PM
 */
public interface Configuration {
	/**
	 * The default path for the settings property file.
	 */
	String DEFAULT_SETTINGS = "/config.properties";
	/**
	 * Returns A {@link java.util.Properties} object containing all the settings.
	 * @return A {@link java.util.Properties} object containing all the settings.
	 */
	Properties getAsProperties();
	/**
	 * Returns the configuration setting.
	 * @param <T> The value class type. 
	 * @param valueClass The class for the value.
	 * @param configSetting The configuration setting.
	 * @return The configuration setting.
	 */
	<T> T getSetting(Class<T> valueClass, ConfigSettings configSetting);
	/**
	 * Returns the configuration setting.
	 * @param <T> The value class type. 
	 * @param valueClass The class for the value.
	 * @param name THe name of the configuration setting.
	 * @return The configuration setting.
	 */
	<T> T getSetting(Class<T> valueClass, String name);
	/**
	 * Returns the configuration setting.
	 * @param configSetting The configuration setting.
	 * @return The configuration setting.
	 */
	Object getSetting(ConfigSettings configSetting);
	/**
	 * Returns the configuration setting.
	 * @param name The name of the configuration setting.
	 * @return The configuration setting.
	 */
	Object getSetting(String name);
	/**
	 * Sets a configuration setting.  This method provides a type safe way of setting the configuration value.
	 * @param <T> The value class type.
	 * @param configSetting The configuration setting.
	 * @param valueClass The class for the value.
	 * @param value The value for the configuration setting.
	 */
	<T> void setSetting(ConfigSettings configSetting, Class<T> valueClass, T value);
	/**
	 * Sets a configuration setting.
	 * @param configSetting The configuration setting.
	 * @param value The value for the configuration setting.
	 */
	void setSetting(ConfigSettings configSetting, Object value);
	/**
	 * Sets a configuration setting.  This method provides a type safe way of setting the configuration value.
	 * @param <T> The value class type.
	 * @param name The name of the configuration setting.
	 * @param valueClass The class for the value.
	 * @param value The value for the configuration setting.
	 */
	<T> void setSetting(String name, Class<T> valueClass, T value);
	/**
	 * Sets a configuration setting.
	 * @param name The name of the configuration setting.
	 * @param value The value for the configuration setting.
	 */
	void setSetting(String name, Object value);
}
